Methods and apparatus to manage workload memory allocation

ABSTRACT

Methods, articles of manufacture, and apparatus are disclosed to manage workload memory allocation. An example method includes identifying a primary memory and a secondary memory associated with a platform, the secondary memory having first performance metrics different from second performance metrics of the primary memory, identifying access metrics associated with a plurality of data elements invoked by a workload during execution on the platform, prioritizing a list of the plurality of data elements based on the access metrics associated with corresponding ones of the plurality of data elements, and reallocating a first one of the plurality of data elements from the primary memory to the secondary memory based on the priority of the first one of the plurality of memory elements.

RELATED APPLICATIONS

This patent arises from a continuation of U.S. patent application Ser.No. 13/992,976, filed on Jun. 10, 2013, which is a 371 National StageEntry of PCT Application Serial No. PCT/US11/67355 filed on Dec. 27,2011, which are hereby incorporated herein by reference in theirentireties.

FIELD OF THE DISCLOSURE

This disclosure relates generally to memory management, and, moreparticularly, to methods and apparatus to manage workload memoryallocation.

BACKGROUND

In recent years, processors have been developed to execute an increasingnumber of floating point operations per second (FLOPS). Designimprovements that contribute to increased FLOPS include, but are notlimited to, greater transistor density and multiple cores. As additionaltransistors and/or cores are added to processors, a correspondingincrease in power consumption and heat occurs, which may becomecounterproductive to FLOPS performance.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic illustration of an example workload managerconstructed in accordance with the teachings of this disclosure tomanage workload memory allocation.

FIG. 2 is an example table indicative of example data elements thatrequest memory access of a platform.

FIG. 3 is an example table indicative of example data array profilesthat request memory access of a platform.

FIGS. 4-6 are flowcharts representative of example machine readableinstructions which may be executed to manage workload memory allocation,to implement the example workload manager of FIG. 1, and/or to build thetables of FIGS. 2 and 3.

FIG. 7 is a block diagram of an example system that may execute theexample machine readable instructions of FIGS. 4-6 to implement theexample workload manager of FIG. 1, and/or to build the tables of FIGS.2 and 3.

DETAILED DESCRIPTION

Methods, articles of manufacture, and apparatus are disclosed to manageworkload memory allocation. An example method includes identifying aprimary memory and a secondary memory associated with a platform, thesecondary memory having first performance metrics different from secondperformance metrics of the primary memory, identifying access metricsassociated with a plurality of data elements invoked by a workloadduring execution on the platform, prioritizing a list of the pluralityof data elements based on the access metrics associated withcorresponding ones of the plurality of data elements, and reallocating afirst one of the plurality of data elements from the primary memory tothe secondary memory based on the priority of the first one of theplurality of memory elements.

FIG. 1 is a schematic illustration of an example workload controller 100to control workload memory allocation. In the illustrated example ofFIG. 1, the workload manager 100 includes a workload manager 102, a dataelement identifier 104, a data element tracker 106, a data elementperformance calculator 108, a memory manager 110, a code modifier 112,and a linker interface 114. The example workload manager 100 iscommunicatively connected to an example platform 116 having one or moreworkloads 118, a primary memory 120, a secondary memory 122, and aprocessor 124.

The example processor 124 of the platform 116 of FIG. 1 includes anynumber of cores to execute the example workload 118. The exampleworkload 118 of FIG. 1 may include, but is not limited to one or moreprograms of executable code (e.g., a binary) generated and linked by acompiler mechanism from source code. The execution of code may include,but is not limited to executing one or more programs, programs havingany number of associated dynamic link libraries (DLLs), one or moreseparate files linked together to the same program, and/or a clusterusage model in which a workload includes a program with any number ofshared libraries involving one or more processes. During execution ofthe example workload 118, the processor 124 may access the primarymemory 120 to manipulate and/or otherwise process data. Data mayinclude, but is not limited to, data arrays, files, heap and/or stack.As used herein, references to data, array data and/or data arraysinclude all types of data that may be processed by the processor 124and/or stored in primary memory 120 and/or secondary memory 122. As usedherein, primary memory 120 includes flash memory, read-only memory(ROM), random access memory (RAM) and/or a hard disk drive memory.Primary memory 120 may include, for example, any type of double datarate (DDR) RAM (e.g., DDR2, DDR3, DDR4, etc.).

In some examples, the secondary memory 122 of the platform 116 includesan enhanced performance design that exhibits a lower latency, coherency,and/or a higher bandwidth capability when compared to the primary memory120. The example secondary memory 122 may include flash memory, ROM, RAMand/or hard disk drive memory having improved performance metric(s) whencompared to corresponding flash memory, ROM, RAM and/or hard disk drivememory corresponding to the example primary memory 120. The examplesecondary memory 122 may have an associated cost premium based on itsimproved performance characteristics and, thus, a correspondingsize/capacity of the secondary memory 122 may be substantially lowerthan that of the primary memory 120. Additionally, utilization of theexample secondary memory 122 is scrutinized because of its relativelyhigher cost and lower size. The example secondary memory 122 mayinclude, but is not limited to scratchpad RAM. Scratchpad RAM is arelatively high-speed internal memory, may be coherent, and may belocated on the processor 124, near the processor 124 and/or withinprocessor packaging.

In operation, the example workload manager 100 identifies one or moreopportunities to improve (e.g., optimize) code that is executed on theexample platform 116. As described above, although additionaltransistors and/or cores added to the processor 124 may yield fasterresults when executing code, the corresponding heat generation and/orpower consumption of the added transistors may eventually providediminishing returns in FLOPS performance. To improve platformperformance when executing one or more workloads 118, the exampleworkload manager 100 identifies memory utilization patterns of theworkload 118. In the event a first data array that is created and/orotherwise manipulated by the example processor 124 exhibits a relativelyhigh demand (e.g., a number of read/write operations when compared to asecond data array, a degree to which the data array materially impactsworkload/platform performance, relative comparisons, etc.), the exampleworkload manager 100 modifies code associated with the example workload118 to utilize a relatively faster type of memory for such read/writeoperations. Code modification performed by the example workload manager100 may include, but is not limited to source code modification, binarymodification, dynamic just-in-time (JIT) compiler modification, etc. Insome examples, code may be re-linked without one or more compilationoperations to, in part, improve speed. The faster type of memory, suchas the example secondary memory 122, allows read/write operations tooccur with lower latency and/or a higher bandwidth than the primarymemory 120, thereby improving the performance of the workload 118 whenexecuting on the example platform 116.

The example workload manager 102 retrieves and/or otherwise receives aworkload 118 from the platform 116 and executes the workload in amonitored environment to characterize its operation. In some examples,the workload manager 102 obtains, retrieves and/or otherwise obtainsinformation associated with the example platform 116, such as one ormore type(s) of memory utilized and/or otherwise available to theplatform 116. As described in further detail below, in the event thatthe platform 116 includes one or more types of memory having improvedoperating characteristics (e.g., the secondary memory 122) when comparedto the example primary memory 120, then the example workload manager 100modifies code (e.g., source code, one or more binaries, binaries on adisk to facilitate subsequent execution optimization, etc.) associatedwith the workload 118 to utilize such memory in an effort to improveplatform performance. The example workload manager 102 may invoke theworkload 118 one or more times to characterize its data array and memoryutilization behavior. In some examples, the workload manager 102 invokesa number of execution iterations of the workload 118 to determineaverage characteristics. In other examples, the workload manager 102invokes the workload 118 with one or more input parameters to identifycorresponding data array and/or memory utilization behavior (e.g.,stress test).

During execution of the example workload 118, the example data elementidentifier 104 identifies instances of data access to one or morememories of the platform 116, such as the example primary memory 120.The example data element tracker 106 counts a number of detectedinstances of data access for each data array employed by the exampleworkload 118, and stores such counts for later analysis of the workload118 behavior. In other examples, collecting and/or monitoring accesscounts may be insufficient to determine a relative grading of the dataarray of interest when compared to one or more other data arrays. Insuch cases, collecting and/or monitoring accesses per unit of time foreach data array of interest allows for a relative grading of which dataarray(s) may contribute the greatest benefit for platform and/orworkload performance. As described above, each data array may includeany type of memory structure employed by the example workload, such asarrays, files, heaps, stacks, registers, etc. The example data elementtracker 106 may also collect intelligence from the workload to send tothe example data element performance calculator 108.

The example data element performance calculator 108 analyzes the storedinstances of data access and generates a table of one or more dataaccess behaviors associated with each data array performing one or moreread/write operations to a memory. As described in further detail below,the table generated by the example data element performance calculator108 may include a count of the number of memory access attempts (accesscount) associated with each data array, a count of the number ofinstances where a memory access attempt results in delay (e.g.,processor spin, processor waiting for a memory to become available forread/write operation(s), stalls associated with loads and/or stores),and/or a number of cycles that occur during instances where the memoryaccess attempt(s) cause a processor spin (e.g., a processor wait event).Based on, in part, one or more count values identified by the exampledata element performance calculator 108, the table of data accessbehaviors may rank (e.g., prioritize) each of the data arrays. In someexamples, the rank (e.g., priority) is based on a number of data arrayaccess instances to memory, while in other examples the rank is based ona number of processor cycles that result from data array accessinstances to memory. Generally speaking, while a first data array mayinclude a relatively greater number of access attempts to one or morememories (e.g., the primary memory 120) when compared to a second dataarray, each memory access instance by the first data array may beassociated with a relatively small amount of data transfer. As such, arelatively high count associated with the first data array may not beindicative of a candidate change (e.g., optimization) for improvingplatform 116 performance via reallocation of data array (e.g., a dataelement) usage of the primary memory 120 to the relatively fastersecondary memory 122. On the other hand, in some examples a relativelylow count associated with the first data array may also be associatedwith a relatively large amount of data transfer during each accessattempt. In such examples, a faster memory may be beneficial whenconfiguring (e.g., optimizing) the platform 116 performance to reduce(e.g., minimize) and/or eliminate processor spin that may otherwiseoccur when relatively slow memory cannot perform read/writeroperation(s) fast enough.

FIG. 2 illustrates an example table 200 generated by the example dataelement performance calculator 108. In the illustrated example of FIG.2, the table 200 includes a data element column 202, an access countcolumn 204, a wait count column 206 and a processor wait cycle countcolumn 208. The example data element column 202 includes a list of dataarrays identified by the example data element identifier 104 that haveparticipated in the example workload 118. While the illustrated exampleof FIG. 2 includes arrays, methods, articles of manufacture and/orapparatus disclosed herein are not limited thereto. For example, otherforms of memory may be realized including, but not limited to scratchmemory, scratchpad(s), heaps, dynamically allocated data objects,stacks, etc. For each identified data array, the example table 200includes a corresponding count value in the access count column 204 thatis indicative of the number of times the data array has made an accessattempt (e.g., read, write, etc.) to a memory of the platform 116.Additionally, the example table 200 includes a corresponding count valuein the wait count column 206 indicative of the number of times the dataarray access has caused a corresponding wait for the processor. Forexample, a first row 210 of the table 200 is associated with “Array 1,”which accessed memory 712 times, but none of those access instancescaused any corresponding spin/wait for the processor 124, as shown bythe “0” in the example wait count column 206. As such, the example“Array 1” did not cause any corresponding cycle count of the exampleprocessor 124, as shown by the “0” in the example processor wait cyclecount column 308.

On the other hand, an example third row 212 of the table 200 isassociated with “Array 3,” and accessed memory 6,219 times in which 101instances of memory access caused the example processor 124 to wait. Thecorresponding number of processor cycles caused by the 101 instances ofprocessor 124 waiting is 5,050 (e.g., each of the 101 access attemptscaused a delay of fifty processor cycles). An example fifth row 214 ofthe table 200 is associated with “Array 5,” and accessed memory 3,921times in which 2,971 instances of memory access caused the exampleprocessor 124 to wait. While “Array 5” accessed memory roughly half asmany times as “Array 3,” the corresponding number of processor cyclescaused by the 2,971 instances of processor 124 waiting during “Array 5”memory accesses is 2.1×10⁹. Relatively speaking, the delay caused by“Array 5” memory accesses is substantially greater than the one or moredelays caused by other data arrays associated with the workload 118 and,thus, example “Array 5” may be a candidate for use with the secondarymemory 122.

In some examples, data elements place memory access demands at one ormore instances during execution of the example workload 118. Forexample, a first data element (e.g., “Array 5”) may perform all of itsmemory access operations during the first half of the execution processassociated with workload 118, while the last half of the executionprocess does not include further access attempts to the first dataelement. The information associated with when data elements placedemands on platform 116 memory may allow the example workload manager100 to allocate memory usage in a manner that preserves the limitedresources of the secondary memory 122.

FIG. 3 illustrates an example data array profile table 300 generated bythe data element performance calculator 108. In the illustrated exampleof FIG. 3, the table 300 includes a data element column 302 and anactivity profile column 304. The example data element performancecalculator 108 generates a plot of memory access activity for eachcorresponding data element (e.g., “Array 1” through “Array 27”) duringthe course of execution (e.g., workload start time 350 through workloadstop time 352) of the example workload 118. During the course ofexecution (horizontal axis), each plot represents a relative magnitudeof access activity with respect to other data elements. A first row 306of the example table 300 is associated with data element “Array 1” andindicates, with an activity profile 308, that memory access activityoccurs during the last three-fourths of workload execution. A third row310 of the example table 300 is associated with data element “Array 5”and indicates, with an activity profile 312, memory access activityoccurs during the first half of workload execution. Additionally, thememory access activity profile associated with “Array 5” 312 is tallerthan the memory access activity profile associated with “Array 1” 308,which indicates a relative difference in the number of access attemptsper unit of time for each data element. In some examples, each accessactivity profile height is compared against one or more thresholdsindicative of a number of memory access instances during a period oftime during workload 118 execution. Other example thresholds may bebased on a number of processor cycles that occur during processor waitperiods (spin) due to memory latency and/or bandwidth limitations. Whilethe example thresholds may be based on express values, other examplethresholds may be based on a relative percentage when compared to all ofthe data arrays active during workload 118 execution.

After the example workload 118 is executed and/or executed for a numberof iterations to collect data array (and/or any other type of memory)behavior information (e.g., workload execution profiles, data elementaccess counts, wait instance counts (e.g., processor wait), etc.), theexample data element identifier 104 selects one of the data elementsfrom the example data element column 202 of the table 200. The examplememory manager 110 determines a size of the example secondary memory 122and a corresponding amount of remaining space of the secondary memory122 that is unused. In the event that the selected data element underreview is indicative of high demand throughout the duration of workload118 execution, and there is enough remaining space in the examplesecondary memory 122, then the example code modifier 112 flags the dataelement to use the secondary memory 122 during execution. In otherexamples, there may be temporal variations of memory use during the lifeof the workload. A threshold value may be used to determine whether theselected data element should utilize the secondary memory 122. Asdescribed below, data elements that are flagged to use a specificmemory, such as the faster secondary memory 122, are later modified bythe example code modifier 112, compiled and/or linked to generate a newbinary and/or modify an existing binary (e.g., without prior source codemodification(s)).

However, in the event that the selected data element does not utilizememory and/or make memory access attempts throughout the duration of theworkload 118 execution, then the example memory manager 110 determineswhether the selected data element utilizes a threshold amount of memoryresources during a portion of the workload 118 execution. In operation,the example memory manager 110 may analyze the activity profiles in theactivity profile column 304 associated with the data element of interestto identify a threshold demand. For example, if the data elementassociated with “Array 5” is analyzed by the memory manager 110, thememory manager 110 may invoke the example code modifier 112 to modifycode (e.g., source code, one or more binaries, etc.) to utilizesecondary memory 122 for a first half of the workload 118, and utilizeprimary memory 120 for a second half of the workload 118. Splittingmemory utilization throughout the duration of the example workload 118may allow higher demand data elements to operate faster when needed, andrelinquish such memory when no longer needed, as shown by eachcorresponding data element profile of FIG. 3.

While an example manner of implementing the workload manager 100 hasbeen illustrated in FIGS. 1-3, one or more of the elements, processesand/or devices illustrated in FIGS. 1-3 may be combined, divided,re-arranged, omitted, eliminated and/or implemented in any other way.Further, the example workload manager 100, the example workload manager102, the example data element identifier 104, the example data elementtracker 106, the example data element performance calculator 108, theexample memory manager 110, the example code modifier 112, the exampleprimary memory 120 and/or the example secondary memory 122 of FIG. 1 maybe implemented by hardware, software, firmware and/or any combination ofhardware, software and/or firmware. Thus, for example, any of theexample workload manager 100, the example workload manager 102, theexample data element identifier 104, the example data element tracker106, the example data element performance calculator 108, the examplememory manager 110, the example code modifier 112, the example primarymemory 120 and/or the example secondary memory 122 could be implementedby one or more circuit(s), programmable processor(s), applicationspecific integrated circuit(s) (ASIC(s)), programmable logic device(s)(PLD(s)) and/or field programmable logic device(s) (FPLD(s)), etc. Whenany of the apparatus or system claims of this patent are read to cover apurely software and/or firmware implementation, at least one of theexample workload manager 100, the example workload manager 102, theexample data element identifier 104, the example data element tracker106, the example data element performance calculator 108, the examplememory manager 110, the example code modifier 112, the example primarymemory 120 and/or the example secondary memory 122 are hereby expresslydefined to include at least one tangible computer readable medium suchas a memory, DVD, CD, BluRay, etc. storing the software and/or firmware.Further still, the example workload manager 100 of FIG. 1 may includeone or more elements, processes and/or devices in addition to, orinstead of, those illustrated in FIGS. 1-3, and/or may include more thanone of any or all of the illustrated elements, processes and devices.

A flowchart representative of example machine readable instructions forimplementing the workload manager 100 of FIG. 1 is shown in FIG. 4. Inthis example, the machine readable instructions comprise a program forexecution by a processor such as the processor 712 shown in the examplecomputer 700 discussed below in connection with FIG. 7. The program maybe embodied in software stored on one or more tangible computer readablemedium(s) such as a CD-ROM, a floppy disk, a hard drive, a digitalversatile disk (DVD), a BluRay disk, or a memory associated with theprocessor 712, but the entire program and/or parts thereof couldalternatively be executed by a device other than the processor 712and/or embodied in firmware or dedicated hardware. Further, although theexample program is described with reference to the flowchart illustratedin FIG. 4, many other methods of implementing the example workloadmanager 100 may alternatively be used. For example, the order ofexecution of the blocks may be changed, and/or some of the blocksdescribed may be changed, eliminated, or combined.

As mentioned above, the example processes of FIGS. 4-6 may beimplemented using coded instructions (e.g., computer readableinstructions) stored on one or more tangible computer readable medium(s)such as a hard disk drive, a flash memory, a read-only memory (ROM), acompact disk (CD), a digital versatile disk (DVD), a cache, arandom-access memory (RAM) and/or any other storage media in whichinformation is stored for any duration (e.g., for extended time periods,permanently, brief instances, for temporarily buffering, and/or forcaching of the information). As used herein, the term tangible computerreadable medium is expressly defined to include any type of computerreadable storage and to exclude propagating signals. Additionally oralternatively, the example processes of FIGS. 4-6 may be implementedusing coded instructions (e.g., computer readable instructions) storedon a non-transitory computer readable medium such as a hard disk drive,a flash memory, a read-only memory, a compact disk, a digital versatiledisk, a cache, a random-access memory and/or any other storage media inwhich information is stored for any duration (e.g., for extended timeperiods, permanently, brief instances, for temporarily buffering, and/orfor caching of the information). As used herein, the term non-transitorycomputer readable medium is expressly defined to include any type ofcomputer readable medium and to exclude propagating signals. As usedherein, when the phrase “at least” is used as the transition term in apreamble of a claim, it is open-ended in the same manner as the term“comprising” is open ended. Thus, a claim using “at least” as thetransition term in its preamble may include elements in addition tothose expressly recited in the claim.

The program 400 of FIG. 4 begins at block 402 in which the exampleworkload manager 102 retrieves, obtains and/or otherwise receives theworkload 118 from the platform 116. The example workload 118 may bestored on a memory of the platform and may include one or moreexecutable programs that utilize one or more resources of the exampleplatform 116. Any number of execution iterations may be invoked by theexample workload manager 102 to characterize the behavior of theworkload on the example platform 116 (block 404). In some examples, theworkload manager 102 invokes the workload 118 to execute once on theplatform 116 when collecting one or more parameters indicative of dataelement behavior. In other examples, the workload manager 102 invokesthe workload 118 to execute through a number of iterations to calculateaverage values of the one or more parameters indicative of data elementbehavior.

During execution of the example workload 118, the data elementidentifier 104 identifies instances of data array access attempts to oneor more memories of the platform 116, such as data array(s) that attemptto access the primary memory 120 (block 406). Generally speaking, somedata arrays are invoked by the workload 118 infrequently and, thus, donot substantially contribute to workload 118 execution delay. In otherexamples, other data arrays that are invoked by the workload 118 makerelatively frequent attempts at memory access (e.g., read/write accessattempts), thereby potentially contributing to overall workload 118execution time to a greater extent. To identify a degree with which dataarrays interact with platform 116 memory, the example data elementtracker 106 gathers performance information, such as, but not limited tocounting a number of instances each data array makes a memory accessrequest and/or identifying processor stalls (block 408). Counting dataaccess instances may include, but is not limited to, employing aperformance monitoring unit (PMU) to gather data from one or more modelspecific registers (MSRs). The MSRs may include counter registers, eventprogramming registers and/or global event registers. Additionally, thePMU may perform event based sampling to count events related toprocessor activity, such as instances where the processor waits formemory availability caused by, for example, memory latency and/or memorybandwidth limitations. In some examples, sampling may occur in responseto perturbation of the workload to appreciate the effect(s) of one ormore forced input(s) to the workload and/or platform.

While the example workload 118 of interest executes on the exampleplatform 116 (block 410), control returns to blocks 406 and 408 anynumber of times to identify data access instances and count a number oftimes each data array makes a memory access attempt. When execution ofthe example workload 118 of interest is complete (block 410), theexample data element performance calculator 108 generates a table (e.g.,the table 200 of FIG. 2) of the collected parameters (block 412). Thecollected parameters may include, but are not limited to a list of dataarrays that have made one or more access attempts to memory, a count ofhow many times each data array makes an access attempt to memory duringthe workload 118 execution, a count of how many times an access attemptby the data array causes a corresponding delay (e.g., wait instances, aprocessor spin, cause processor to wait on memory that is not finishedwith a prior read/write operation), and/or a count of a number ofprocessor cycles that elapse during the workload 118 execution while theprocessor is waiting for access to the memory (e.g., the primary memory120). While the example table 200 (see FIG. 2) is described herein asbeing created by the example data element performance calculator 108,any other type of workload profile representation may be generatedincluding, but not limited to a heatmap of data array memory accessactivity. Additionally, the example data element performance calculator108 generates an example data array profile table 300 (see FIG. 3) toidentify a temporal indication of data array memory access duringexecution of the workload 118 (block 412) as described in further detailbelow.

To determine whether one or more data arrays can efficiently utilize thesecondary memory 122 during execution of the workload 118, the examplememory manager 110, the example data element identifier 104, the exampledata element performance calculator 108, and the example code modifier112 analyze secondary memory consumption (block 414). As described infurther detail below, one or more data arrays may be allocated to usehigher-performing secondary memory 122 if a corresponding performanceimprovement is expected. In the event that a performance improvement isexpected, the example code modifier 112 modifies code (e.g., sourcecode, one or more binaries, etc.) associated with one or more dataarrays so that the higher-performing secondary memory 122 is utilizedduring execution of the workload 118 (block 416). The example linkerinterface 114 invokes a compiler/linker to compile and/or link themodified code to generate a new binary that is improved (e.g.,optimized) to utilize the higher-performing secondary memory 122 duringall or part of the workload 118 execution (block 418). In some examples,a compiler is not needed and/or otherwise bypassed when one or morebinaries are being modified without concern for corresponding sourcecode. In other examples, profile information may be analyzed and directthe example linker interface 114, a binary modifier and/or a runtimeloader to regenerate one or more binaries.

Turning to FIG. 5, additional detail associated with analyzing dataaccess instances (block 412) is shown. In the illustrated example ofFIG. 5, the example data element performance calculator 108 generates atable with data elements (data arrays) that have performed at least onedata access attempt to platform 116 memory, such as the example primarymemory 120 (block 502). For instance, the example table 200 of FIG. 2includes a data element column 202 containing a list of one or more dataarrays that have made one or more attempts to access platform 116memory. The example data element performance calculator 108 also countsa number of access attempts associated with each data element (block504), as shown in the example access count column 204 of FIG. 2. In theevent one or more of the data elements in the example data elementcolumn 202 include a data array that caused the processor 124 to wait(e.g., a spin of wasted processor cycles), the example data elementperformance calculator 108 counts a corresponding number of instances ofthat occurrence (block 506). Additionally, a degree of severity of suchprocessor wait instances is determined by the example data elementperformance calculator 108 by counting a corresponding number ofprocessor cycles that occur during such wait instances (block 508).

To determine temporal portions of the workload 118 execution in whichone or more data arrays access memory, the example data elementperformance calculator 108 generates a data array profile table 300(block 510), as shown in FIG. 3. As described above, the data elementperformance calculator 108 generates a profile associated with each dataarray to show which relative portion of the workload 118 execution isassociated with memory access activity. At least one benefit ofdetermining relative temporal locations within the workload 118 where adata array accesses memory, is that the higher-performing secondarymemory 122 can be judiciously shared between one or more data arraysduring execution of the workload 118. For example, if two data arrays ofthe workload 118 cannot both be utilized simultaneously due to memorysize limitations of the secondary memory 122, a first data array may usethe secondary memory 122 for a portion of the workload 118 execution,and then relinquish the secondary memory 122 so that a second data arraycan utilize the secondary memory 122 for the remaining portion of theworkload 118 execution. The example data element performance calculator108 may also categorize the one or more data elements based on one ormore thresholds and/or assign a rank order to determine which dataelements should be allocated to the higher-performing secondary memory122 (block 512). In other examples, developing a cost model ofperformance may indicate that utilization of the secondary memory 122may not result in an appreciated benefit to overall platformperformance.

Turning to FIG. 6, additional detail associated with analyzing thesecondary memory 122 consumption (block 414) is shown. In theillustrated example of FIG. 6, the example data element identifier 104selects one of the data elements (data arrays) of interest from thetable 200 of FIG. 2 and/or the data array profile table 300 of FIG. 3.In some examples, the data element is selected based on a correspondingrank order, as described above. For instance, the data elementassociated with a highest processor count wait value may be selected asthe best candidate data element for improving (e.g., optimizing)platform 116 performance. Higher-performing secondary memory, such asthe example secondary memory 122, may be substantially smaller and/ormore expensive than primary memory 120. To determine the size ofsecondary memory 122 associated with the platform 116, the examplememory manager 110 determines a corresponding size of the secondarymemory 122 (block 604), and determines available remaining space thereof(block 606). In other examples, the size of the secondary memory 122 isstatic and may be performed once rather than within a loop, such asafter a workload is obtained (block 402).

If the example data element performance calculator 108 determines thatthe data array of interest exhibits a relatively high occurrence ofaccess attempts to memory throughout the execution of the exampleworkload 118 (block 608), then the example memory manager 110 determineswhether the secondary memory 122 has sufficient space to accommodate thedata array of interest (block 610). If not, then the example dataelement identifier 104 determines whether additional candidate dataarrays are available for consideration (block 612). For example, thedata element identifier 104 may select the next-highest ranked dataarray in the table 200 of FIG. 2. On the other hand, in the event thatthere is sufficient room in the secondary memory 122 for the candidatedata array of interest (block 610), then the example code modifier 112flags the data array for modification (block 614) so that, after allcandidate data arrays have been considered, the code (e.g., one or morebinaries, source code, etc.) associated with the flagged data arrays maybe modified (see block 416 of FIG. 4).

In the event that the data element performance calculator 108 determinesthat the data array of interest attempts to access memory for a portionof time (e.g., a threshold portion) during workload 118 execution (block608), then the example memory manager determines whether such accessattempts exceed a threshold demand (block 616). As described above, thethreshold demand may be indicative of a number of memory accessinstances during a period of time during workload 118 execution, arelative number of memory access instances when compared to all dataarrays and/or based on a number (or relative number) of processor cyclesthat occur during processor wait periods (spin) due to memory latencyand/or bandwidth limitations. During the portion of workload 118execution time at which the data element (data array) of interestexceeds one or more threshold values that are indicative of memoryaccess demands and/or indicative of causing processor cycle delay, theexample code modifier 112 flags the data element of interest to use thesecondary memory 122 for that portion of the workload 118 execution(block 618). If additional data elements remain in the example table 200of FIG. 2 and/or the data array profile table 300 of FIG. 3 (block 612),then control returns to block 602.

FIG. 7 is a block diagram of an example computer 700 capable ofexecuting the instructions of FIGS. 4-6 to implement the workloadmanager 100 of FIG. 1. The computer 700 can be, for example, a server, apersonal computer, a mobile phone (e.g., a cell phone), a personaldigital assistant (PDA), an Internet appliance, a gaming console, a settop box, or any other type of computing device.

The computer 700 of the instant example includes a processor 712. Forexample, the processor 712 can be implemented by one or moremicroprocessors or controllers from any desired family or manufacturer.

The processor 712 is in communication with a main memory including avolatile memory 714 and a non-volatile memory 716 via a bus 718. Thevolatile memory 714 may be implemented by Synchronous Dynamic RandomAccess Memory (SDRAM), Dynamic Random Access Memory (DRAM), RAMBUSDynamic Random Access Memory (RDRAM) and/or any other type of randomaccess memory device. The non-volatile memory 716 may be implemented byflash memory and/or any other desired type of memory device. Access tothe main memory 714, 716 is controlled by a memory controller.

The computer 700 also includes an interface circuit 720. The interfacecircuit 720 may be implemented by any type of interface standard, suchas an Ethernet interface, a universal serial bus (USB), and/or a PCIexpress interface.

One or more input devices 722 are connected to the interface circuit720. The input device(s) 722 permit a user to enter data and commandsinto the processor 712. The input device(s) can be implemented by, forexample, a keyboard, a mouse, a touchscreen, a track-pad, a trackball,isopoint and/or a voice recognition system.

One or more output devices 724 are also connected to the interfacecircuit 720. The output devices 724 can be implemented, for example, bydisplay devices (e.g., a liquid crystal display, a cathode ray tubedisplay (CRT), a printer and/or speakers). The interface circuit 720,thus, typically includes a graphics driver card.

The interface circuit 720 also includes a communication device (e.g.,communication device 756) such as a modem or network interface card tofacilitate exchange of data with external computers via a network 726(e.g., an Ethernet connection, a digital subscriber line (DSL), atelephone line, coaxial cable, a cellular telephone system, etc.).

The computer 700 also includes one or more mass storage devices 728 forstoring software and data. Examples of such mass storage devices 728include floppy disk drives, hard drive disks, compact disk drives anddigital versatile disk (DVD) drives.

The coded instructions 758 of FIGS. 4-6 may be stored in the massstorage device 728, in the volatile memory 714, in the non-volatilememory 716, and/or on a removable storage medium such as a CD or DVD.

From the foregoing, it will be appreciated that the above disclosedmethods, apparatus and articles of manufacture facilitate memorymanagement by identifying candidate data elements, which may includedata arrays, stack, heap, etc., that utilize memory resourcesresponsible for platform delay. By rewriting code (e.g., source code,one or more binaries, etc.) in a manner that allocates the candidatedata elements to use a higher-performing memory type, the overalloperation of the platform may be improved (e.g., optimized) by reducingor even eliminating wasted processor cycles caused by data elementswaiting on access to relatively slower memory.

Methods, systems, apparatus and articles of manufacture are disclosed tomanage workload memory allocation. Some disclosed example methodsinclude identifying a primary memory and a secondary memory associatedwith a platform, the secondary memory having first performance metricsdifferent from second performance metrics of the primary memory,identifying access metrics associated with a plurality of data elementsinvoked by a workload during execution on the platform, prioritizing alist of the plurality of data elements based on the access metricsassociated with corresponding ones of the plurality of data elements,and reallocating a first one of the plurality of data elements from theprimary memory to the secondary memory based on the priority of thefirst one of the plurality of memory elements. Additionally, the examplemethods include the secondary memory having a lower latency than theprimary memory, or the secondary memory having a higher bandwidth thanthe primary memory. In some examples, the access metrics include anumber of access attempts by corresponding ones of the plurality of dataelements to the primary memory, include detecting whether at least oneof the number of access attempts caused a wait event, include counting anumber of processor cycles associated with the wait event, and whereprioritizing the list of the plurality of data elements includescomparing the number of processor cycles associated with each of theplurality of data elements. Some examples include prioritizing the listof the plurality of data elements by comparing the number of wait eventsassociated with the plurality of data elements, and in other examplesidentifying the access metrics further includes measuring a number ofaccess attempts per unit of time associated with the plurality of dataelements. Examples disclosed herein also include selecting one of theplurality of data elements to reallocate from the primary memory to thesecondary memory when the number of access attempts per unit of timeexceeds a threshold value, and further include reallocating a first oneof the plurality of data elements from the primary memory to thesecondary memory when the number of access attempts per unit of timeexceeds a threshold, and reallocating the first one of the plurality ofdata elements from the secondary memory to the primary memory when thenumber of access attempts per unit of time is lower than the threshold.Still further examples include the first one of the plurality of dataelements utilizing the secondary memory for a first portion of theexecution of the workload, and utilizing the primary memory for a secondportion of the execution of the workload. Some examples include thefirst one of the plurality of data elements utilizing the secondarymemory while a second one of the plurality of data elements utilizes theprimary memory, and other examples include alternating the utilizationof the first one of the plurality of data elements from the secondarymemory to the primary memory with the utilization of the second one ofthe plurality of data elements from the primary memory to the secondarymemory. Other examples include reallocating the first one of theplurality of data elements from the primary memory to the secondarymemory when the secondary memory has space for the first one of theplurality of data elements.

Example apparatus to manage workload memory for data element utilizationinclude a workload manager to identify a primary memory and a secondarymemory associated with a platform, the secondary memory having firstperformance metrics different from second performance metrics of theprimary memory, a workload controller to identify access metricsassociated with a plurality of data elements invoked by a workloadduring execution on the platform, a data element performance calculatorto prioritize a list of the plurality of data elements based on theaccess metrics associated with corresponding ones of the plurality ofdata elements, and a memory manager to reallocate a first one of theplurality of data elements from the primary memory to the secondarymemory based on the priority of the first one of the plurality of memoryelements. Additional example apparatus include the memory managerselecting the secondary memory based on a lower latency parameter thanthe primary memory, and in which the memory manager selects thesecondary memory based on a higher bandwidth than the primary memory,and/or in which the data element performance calculator is to determinewhether an access attempt to the primary memory causes a wait event.Other example apparatus include a code modifier to reallocate dataelement usage from the primary memory to the secondary memory when anumber of access attempts per unit of time exceeds a threshold value, inwhich the code modifier modifies at least one of source code or a binaryassociated with the workload.

Some disclosed example articles of manufacture storing machine readableinstructions are included that, when executed, cause a machine toidentify a primary memory and a secondary memory associated with aplatform, the secondary memory having first performance metricsdifferent from second performance metrics of the primary memory,identify access metrics associated with a plurality of data elementsinvoked by a workload during execution on the platform, prioritize alist of the plurality of data elements based on the access metricsassociated with corresponding ones of the plurality of data elements,and reallocate a first one of the plurality of data elements from theprimary memory to the secondary memory based on the priority of thefirst one of the plurality of memory elements. Other example articles ofmanufacture cause the machine to determine a quantity of access attemptsby corresponding ones of the plurality of data elements to the primarymemory, and to detect whether at least one of the number of accessattempts caused a wait event. Still other example articles ofmanufacture cause the machine to count a number of processor cyclesassociated with the wait event, to compare the number of processorcycles associated with each of the plurality of data elements toprioritize the list of the plurality of data elements, and to comparethe number of wait events associated with the plurality of data elementsto prioritize the list of the plurality of data elements. Still furtherarticles of manufacture cause the machine to measure measuring a numberof access attempts per unit of time associated with the plurality ofdata elements to identify the access metrics, to select one of theplurality of data elements to reallocate from the primary memory to thesecondary memory when the number of access attempts per unit of timeexceeds a threshold value, and to reallocate a first one of theplurality of data elements from the primary memory to the secondarymemory when the number of access attempts per unit of time exceeds athreshold, and reallocate the first one of the plurality of dataelements from the secondary memory to the primary memory when the numberof access attempts per unit of time is lower than the threshold. In someexample articles of manufacture, the machine is to cause a machine toutilize, with the first one of the plurality of data elements, thesecondary memory for a first portion of the execution of the workload,and utilize the primary memory for a second portion of the execution ofthe workload, and to utilize, with the first one of the plurality ofdata elements, the secondary memory while a second one of the pluralityof data elements utilizes the primary memory. Additionally, examplearticles of manufacture cause the machine to alternate the utilizationof the first one of the plurality of data elements from the secondarymemory to the primary memory with the utilization of the second one ofthe plurality of data elements from the primary memory to the secondarymemory, and to reallocate the first one of the plurality of dataelements from the primary memory to the secondary memory when thesecondary memory has space for the first one of the plurality of dataelements.

Although certain example methods, apparatus and articles of manufacturehave been described herein, the scope of coverage of this patent is notlimited thereto. On the contrary, this patent covers all methods,apparatus and articles of manufacture fairly falling within the scope ofthe claims of this patent.

What is claimed is:
 1. A method to manage memory usage, comprising:accessing activity profiles respectively associated with accesses to aplurality of data elements by a workload executed on a platform having aprimary memory and a secondary memory, the primary memory having a firstperformance metric different from a second performance metric of thesecondary memory; reallocating, with a processor, a first data elementof the plurality of data elements from the primary memory to thesecondary memory for a first duration of the workload based on a firstactivity profile of the activity profiles; and reallocating, with theprocessor, the first data element from the secondary memory to theprimary memory for a second duration of the workload based on at leastone of the first activity profile or a second activity profile of theactivity profiles.
 2. The method as defined in claim 1, furtherincluding: reallocating a second data element of the plurality of dataelements from the primary memory to the secondary memory for the secondduration of the workload based on at least one of the activity profiles;and reallocating the second data element from the secondary memory tothe primary memory during a third duration of the workload based on atleast one of the activity profiles.
 3. The method as defined in claim 1,wherein the activity profiles identify memory accesses to correspondingones of the data elements in the primary memory.
 4. The method asdefined in claim 3, wherein the first data element is reallocated fromthe primary memory to the secondary memory for the first duration of theworkload when a first number of the memory accesses corresponding to thefirst data element is above a threshold during the first duration of theworkload, and the first data element is reallocated from the secondarymemory to the primary memory for the second duration of the workloadwhen a second number of the memory accesses corresponding to the firstdata element is below the threshold during the second duration of theworkload.
 5. The method as defined in claim 1, wherein the activityprofiles include numbers of processor cycles associated withcorresponding wait events during attempts to access corresponding onesof the plurality of data elements in the primary memory.
 6. The methodas defined in claim 1, wherein at least one of the activity profilesincludes a difference between a first number of accesses of at least oneof the data elements and a second number of accesses of another one ofthe data elements.
 7. The method as defined in claim 1, wherein thedifference between the first performance metric and the secondperformance metric is based on the secondary memory having less latencythan the primary memory, the latency being one of a read latency or awrite latency.
 8. The method as defined in claim 1, wherein thedifference between the first performance metric and the secondperformance metric is based on a the secondary memory having morebandwidth than the primary memory, the bandwidth being one of a readbandwidth or a write bandwidth.
 9. An apparatus to manage memory usage,comprising: a workload controller to access activity profilesrespectively associated with accesses to a plurality of data elements bya workload executed on a platform having a primary memory and asecondary memory, the primary memory having a first performance metricdifferent from a second performance metric of the secondary memory; anda memory manager to: reallocate a first data element of the plurality ofdata elements from the primary memory to the secondary memory for afirst duration of the workload based on a corresponding first activityprofile of the activity profiles; and reallocate the first data elementfrom the secondary memory to the primary memory for a second duration ofthe workload based on at least one of the first activity profile or asecond activity profile of the activity profiles.
 10. The apparatus asdefined in claim 9, wherein the memory manager is further to: reallocatea second data element of the plurality of data elements from the primarymemory to the secondary memory for the second duration of the workload,based on at least one of the activity profiles; and reallocate thesecond data element from the secondary memory to the primary memoryduring a third duration of the workload based on the at least one of theactivity profiles.
 11. The apparatus as defined in claim 9, wherein theactivity profiles identify memory accesses to corresponding ones of thedata elements in the primary memory.
 12. The apparatus as defined inclaim 11, wherein the memory manager is further to: reallocate the firstdata element from the primary memory to the secondary memory for thefirst duration of the workload when a first number of the memoryaccesses corresponding to the first data element is above a thresholdduring the first duration of the workload; and reallocate the first dataelement from the secondary memory to the primary memory for the secondduration of the workload when a second number of the memory accessescorresponding to the first data element is below the threshold duringthe second duration of the workload.
 13. The apparatus as defined inclaim 9, wherein the activity profiles include numbers of processorcycles associated with corresponding wait events during attempts toaccess corresponding ones of the plurality of data elements in theprimary memory.
 14. The apparatus as defined in claim 9, wherein each ofthe activity profiles includes a difference between a first number ofaccesses of at least one of the data elements and a second number ofaccesses of another one of the data elements.
 15. The apparatus asdefined in claim 9, wherein the difference between the first performancemetric and the second performance metric is based on a the secondarymemory having more bandwidth than the primary memory, the bandwidthbeing one of a read bandwidth or a write bandwidth.
 16. A tangiblecomputer readable storage medium comprising instructions that, whenexecuted, cause a machine to at least: access activity profilesrespectively associated with accesses to a plurality of data elements bya workload executed on a platform having a primary memory and asecondary memory, the primary memory having a first performance metricdifferent from a second performance metric of the secondary memory; andreallocate a first data element between the primary memory and thesecondary memory for different durations of the workload based on atleast one of the activity profiles associated with the plurality of dataelements.
 17. The tangible computer readable storage medium as definedin claim 16, wherein the instructions are further to cause the machineto reallocate a second data element between the primary memory and thesecondary memory for different durations of the workload based on atleast one of the activity profiles associated with the plurality of dataelements.
 18. The tangible computer readable storage medium as definedin claim 16, wherein the instructions are further to cause the machineto: reallocate the first data element from the primary memory to thesecondary memory for a first duration of the workload when a number ofthe memory accesses to the first data element is above a thresholdduring the first duration of the workload; and reallocate the first dataelement from the secondary memory to the primary memory for a secondduration of the workload when a number of the memory access activity tothe first data element is below the threshold during the second durationof the workload.
 19. The tangible computer readable storage medium asdefined in claim 16, wherein the activity profiles include numbers ofprocessor cycles associated with corresponding wait events duringattempts to access corresponding ones of the plurality of data elementsin the primary memory.
 20. The tangible computer readable storage mediumas defined in claim 16, wherein each of the activity profiles includes adifference between a first number of accesses of at least one of thedata elements and a second number of accesses of another one of the dataelements.